package com.zenithmind.user.enums;

import lombok.Getter;

@Getter
public enum VerificationCodeType {
    LOGIN(0, "登录验证码"),
    REGISTRATION(1, "注册验证码"),
    RESET_PASSWORD(2, "重置密码验证码"),
    UPDATE_EMAIL(3, "修改邮箱验证码"),
    GENERAL(4, "通用验证码");

    private final int value;
    private final String description;

    VerificationCodeType(int value, String description) {
        this.value = value;
        this.description = description;
    }

    public static VerificationCodeType fromValue(int value) {
        for (VerificationCodeType type : values()) {
            if (type.value == value) {
                return type;
            }
        }
        throw new IllegalArgumentException("Invalid VerificationCodeType value: " + value);
    }
} 